f = open('c:/taskpath/test.txt', 'w')

f.seek(1024 *1024*1024 *4)
f.write('hi')
f.close()